#include "Protheus.ch"

User Function TstMsSelect()

Local cLabel   := ""
Local cLabel2  := ""
Local cLabel3  := ""
Local cLabel4  := ""
Local cMarca   := ""

Local lInverte := .F.

Local nQtdBem  := 0
Local nQtde    := 0
Local nOpcRad  := 0
Local nOpcRad2 := 0
Local nValor   := 0

Local oDlg1    := Nil
Local oGet     := Nil
Local oGet2    := Nil
Local oLabel   := Nil
Local oLabel2  := Nil
Local oLabel3  := Nil
Local oLabel4  := Nil
Local oRad     := Nil
Local oRad2    := Nil
Local oValor   := Nil
Local oQtda    := Nil

DEFINE MSDIALOG oDlg1 TITLE "Selecao para Transferencia" From 9, 0 To 32, 80 OF oMainWnd

	@1.4, .8 Say "Valor Total:"
	@1.4, 7 Say oValor VAR nValor Picture "@E 999,999,999,999.99"
	
	@1.9, .8 Say "Quantidade:"
	@1.9, 9 Say oQtda VAR nQtdBem Picture "@E 99999" SIZE 50, 10
	
	@1.4, 15 Say IIF(MVParBox01 == 1, "Somente grupos de [" + MVParBox02 + "] ate [" + MVParBox03 + "]", "")
	
	IF cTipoDet == "D"
		@12.4, 01 Say "Qtde. a Detalhar"
		@158, 60 MSGET nQtde Picture "@E 999" SIZE 036, 10 OF oDlg PIXEL VALID nQtde > 0
	ElseIF cTipoDet == "P"
		@12.4, 01 Say oLabel Var cLabel := "Tipo de Projeto"
		oRad := TRadMenu():New(169, 005, {"Industrial", "Florestal"}, bSetGet(nOpcRad), oDlg, , {|| AF250RAD(nOpcRad)} , , , , , , 100, 12, , , , .T.)
		
		@15.5, 01 Say oLabel2 Var cLabel2 := "Detalhamento:"
		oRad2 := TRadMenu():New(210, 005, {"Manter", "Alterar"}, bSetGet(nOpcRad2), oDlg, , {|| AF250RAD2(nOpcRad2)} , , , , , , 100, 12, , , , .T.)
		
		@16.4, 01 Say oLabel3 Var cLabel3 := "Percentual"
		oGet := TGet():New(210, 043, bSetGet(nPerc), oDlg, 030, 010, "@E 999.99", , , , , , , .T.)
		
		@18.2, 01 Say oLabel4 Var cLabel4 := "Qtde. Det."
		oGet2 := TGet():New(235, 040, bSetGet(nQtde), oDlg, 030, 010, "@E 999", , , , , , , .T.)
		
		oGet:Hide()
		oGet2:Hide()
		oLabel3:Hide()
		oLabel4:Hide()
	EndIF
	
	oMark       := MsSelect():New("SN3", "N3_OK", "!N3_BAIXA", , @lInverte, @cMarca, {35, 1, 143, 315})
	oMark:bMark := {|| a250Display(cMarca, lInverte, oValor, oQtda)}

ACTIVATE MSDIALOG oDlg1 ON INIT EnchoiceBar(oDlg1, {|| nOpct := 1, Iif(DeParaEnt(), oDlg1:End(), .F.)}, {|| nOpct := 2, oDlg1:End()})

Return Nil
